By now, your app
functionality is complete and your users are eager to get their hands on it. However, as a developer, it's important to have other people test
your application. Therefore, you will
typically need to build your app to be shared and
installed on devices. In this video, you are going to learn about how to turn
your projects into a file format that is
ready to be uploaded to either Google Play Store
or the Apple App Store. Note that while you
may have been using Snack throughout this
course to build your app, here, you'll be guided to use Expo CLI to create
your final build. When you work with Expo, the online snack editor
is an environment that is straightforward when developing
an Expo application. The snack environment
eliminates the task of you performing any
Expo configuration. It hides several files among other details so that you can focus on your
app requirements. Let's begin by exporting your Snack project into a
fully-fledged Expo application. To do that, select the ''Download as zip'' button
in the top right corner. This outputs a zip file. Now unzip the file
to gain access to the Expo project
filled with files you can use even outside Snack. Great. It's important
to note that Expo works hard to simplify the
building process for React Native Applications. It creates its own
solution called EAS build. EAS stands for Expo
Application Services. It comprises several
integrated Cloud services for Expo applications and
EAS is one of them. What is EAS build? EAS build is a hosted
service for building app binaries for Expo and
bare React Native projects. Now, let's outline some of
the key aspects of EAS build. EAS build provides sensitive
defaults or opted in configuration values that work well for Expo and
React Native projects. It's also capable of managing your app signing credentials. Finally, EAS allows you
to seamlessly share your project builds with your team via internal
distribution. Now you're ready to dive in by getting started with
your EAS build. First, install the
latest EAS CLI to interact with EAS
services from your terminal. To do that, run the
following command, npm install -g eas-cli. Now login to your Expo account
if you haven't done so already and run the following
command, EAS login. Skip this step if you have
already logged in earlier. The next step is to configure
the project by running the following command,
eas build:configure. This prompts you with
different options. Since it's your first time
setting up EAS build, you will need to complete
some additional steps. When faced with the prompts
to automatically create an EAS project, type yes. When prompted with would
you like us to run Git in it for you,
again, type yes. EAS build needs an existing
Git repository to work with. If you have one already, you can skip this step. The last prompt is, which platforms would you
like to configure for EAS build and presents
the options all, iOS or Android, respond by selecting
one of the options. At this point, notice
that a new file called EAS.json is
automatically generated. This is great because it means your project is ready to build. Next, let's explore building an APK for Android
emulators and devices. In your browser, go to the URL
docs.expo.dev/build-reference/APK. You'll also find a link to this in the
additional resources, install the build directly to your Android device or
emulator by building an Android package instead of the Android app bundle
Google Play Store expects. Recognize that the
Android package uses the file extension.APK. To begin building
your Android package, open the EAS.json file you've already generated
to make some changes. There are three properties you can add to the build profile, setting development
client property to true, which is the default, setting the build
type property to APK, or setting the gradle
command property to either:app:assembleRelease
or:app:assembleDebug. In this case, let's go
with the default option. Now run your build with
the following command. EAS build -p Android
--profile development. The command triggers
a remote build. Wait patiently for a few
minutes while it completes. Also, when prompted
about credentials, it's recommended to allow
EAS build to manage the key store as files if you haven't
created them already. Next, you can choose the
name for the profile. In this example, the
profile name is preview. However, you may
choose to call it local simulator or anything
else that makes sense to you. Now that you've created
your Android package, it's time to install
your build using ADB. You might be wondering
what ADB is. The Android Debug Bridge, referred to as ADB, is the simplest tool
to run your builds in either an emulator or
a physical device. If you don't have it
installed already, go ahead and follow the steps in the ADB installation link, which is found on the APK page. Alternatively, you can access the link in
additional resources. Once your installation
is complete, open up your emulator or connect your device
to your computer. Ensure that you enable ADB
debugging on your device. Once your build is complete, download the APK from the build
details page or reference the docs.Expo.dev link
when EAS build is done. Next run the following
command to install the APK ADB install, followed by the folder path to wherever you downloaded
the APK file, this installs your
application on either the simulator or
the physical device. That's it. Now, locate the application on the
phone and finally run it. Now you have a preview of what your final application
will look like before uploading it to the
Google Play Store without any store developer
membership account. Next, let's unpack building
for iOS simulators. You can find the complete
process details on the build reference
simulator section on the official
documentation webpage. A link to this can be found
in the additional resources. Begin by editing
the EAS.json file. Here, add a new key called iOS
to the build.preview path. You can do this by
adding a new line beneath preview and typing ''iOS'': and a set
of curly braces. Within these curly braces, type ''simulator'':
and then true. The next step is to install
the build in the simulator. If you haven't installed or
run the iOS simulator before, follow the iOS
simulator guide on the Expo documentation
webpage before proceeding. With your build complete, go ahead and download the build from the build details page. Alternatively, use the
official documentation link on the docs.Expo.dev webpage. Then extract the
contents by opening it. Notice you now have a file
that resembles myapp.app. Open up the simulator and
drag the myapp.app into it. The app installs
within a few seconds. Finally, once your
app appears on the simulator home
screen, tap it to run it. In this video, you
learned how to convert your Snack project
into a file format that is ready to be uploaded to either Google Play Store
or the Apple App Store.